function main(params,index){
    debugger
    const self = this;
    selectDataStyle(self, params['20f1d6c4-a473-48cd-b166-69c9af4b8604']);
    filterList(self, params['20f1d6c4-a473-48cd-b166-69c9af4b8604'])
}


function filterList(self, id) {
    const pageTableList = self.$$("page_widget_list_2utb6k");
    if (pageTableList) {
        if (pageTableList.dataEngine && pageTableList.dataEngine.state) {
            // 给列表组件设置参数，参数名meter_id为要过滤列表中的列名，后面为参数值，取自树节点参数
            pageTableList.$children[0].$$setExtraParams({
                solution_id: id
            })
            // 找到列表部件中的表格组件元素
            let tableComp = pageTableList.dataEngine.state.getElement("table_4avjqe");
            if (tableComp) {
                //执行列表刷新
                tableComp.$$refreshData();
            }
        }
    }
}


function selectDataStyle(self, solutionId) {
    // 找到表格组件元素
    var ele = self.$$element("table_9ylk0h");
    if (ele && ele.$el) {
        // 首先清除旧标记
        var oldls = ele.$el.querySelectorAll("tr[old-click='old-click']");
        if (oldls.length) {
            for (let i = 0; i < oldls.length; i++) {
                let n = oldls[i];
                if (n) {
                    // 仅做标记
                    n.removeAttribute("old-click", "old-click");
                    n.style.backgroundColor = "unset";
                }
            }
        }

        // params.id为列表中的主键列，根据实际情况调整
        let id = parseInt(solutionId);
        let rowKey  = getRowKeyById(self.dataList, id);
        var selector = "tr[data-row-key='" + rowKey + "']";
        var ls = ele.$el.querySelectorAll(selector);
        if (ls.length) {
            for (let i = 0; i < ls.length; i++) {
                let node = ls[i];
                if (node) {
                    // 仅做标记
                    node.setAttribute("old-click", "old-click");
                    node.style.backgroundColor = "#F0F9FF";
                }
            }
        }
    }
}

function getRowKeyById(data, idValue) {
    const item = data.find(element => element.id.value === idValue);
    return item ? item.rowkey : null;
}
